#pragma once
#include "lztp_message_body.h"
#include <stdint.h>
#include <stdint.h>
#include <string>
#include "lztp_request.h"
#include "lztp_response.h"
#include "lztp_message.h"
using namespace std;

class loginReq : public message_body
{
public:
	loginReq() {}
	virtual ~loginReq() {}

	virtual uint32_t parse_bytes(byte_buffer& buffer)
	{
		buffer << name << password << sizes;
		return sizeof(buffer);
	}

	virtual uint32_t to_bytes(byte_buffer& buffer)
	{
		buffer >> name >> password >> sizes;
		return sizeof(buffer);
	}

	virtual uint32_t calc_length() { return 0; }

public:
	string		name;      //login name 
	string		password;      //login password 
	std::vector<uint32_t>		sizes;

};



class loginResp : public message_body
{
public:
	loginResp() {}
	virtual ~loginResp() {}

	virtual uint32_t parse_bytes(byte_buffer& buffer)
	{
		buffer << result;
		return sizeof(buffer);
	}

	virtual uint32_t to_bytes(byte_buffer& buffer)
	{
		buffer >> result;
		return sizeof(buffer);
	}

	virtual uint32_t calc_length() { return 0; }

public:
	uint32_t		result;

};

